]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Remove rewriteRules
authorIvan Molodetskikh <yalterz@gmail.com>
Thu, 26 Aug 2021 11:42:59 +0000 (11:42 +0000)
committerIvan Molodetskikh <yalterz@gmail.com>
Thu, 26 Aug 2021 11:45:19 +0000 (14:45 +0300)
It's not really Shell's business to fix bad app notification contents.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1962>

js/ui/notificationDaemon.js

index f94edb65c2cb6afd2daa1f90f58ed20f619004b9..69137b1b2309856f58e1ba4cdd39f1c768e32293 100644 (file)
@@ -25,17 +25,6 @@ var Urgency = {
     CRITICAL: 2,
 };
 
-const rewriteRules = {
-    'XChat': [
-        { pattern:     /^XChat: Private message from: (\S*) \(.*\)$/,
-          replacement: '<$1>' },
-        { pattern:     /^XChat: New public message from: (\S*) \((.*)\)$/,
-          replacement: '$2 <$1>' },
-        { pattern:     /^XChat: Highlighted message from: (\S*) \((.*)\)$/,
-          replacement: '$2 <$1>' },
-    ],
-};
-
 var FdoNotificationDaemon = class FdoNotificationDaemon {
     constructor() {
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(FdoNotificationsIface, this);
@@ -166,15 +155,6 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
             return invocation.return_value(GLib.Variant.new('(u)', [id]));
         }
 
-        let rewrites = rewriteRules[appName];
-        if (rewrites) {
-            for (let i = 0; i < rewrites.length; i++) {
-                let rule = rewrites[i];
-                if (summary.search(rule.pattern) != -1)
-                    summary = summary.replace(rule.pattern, rule.replacement);
-            }
-        }
-
         // Be compatible with the various hints for image data and image path
         // 'image-data' and 'image-path' are the latest name of these hints, introduced in 1.2